import React, { useCallback, useEffect, useState } from "react";
//
import HistoryInventoryPage from "./common/HistoryInventoryPage";
import MakeInventoryPage from "./common/MakeInventoryPage";
import HeaderTab from "@/components/CommonTab";
//
const tabArr = [
	{
		key: "1",
		tab: "到货清点"
	},
	{
		key: "2",
		tab: "历史清点明细"
	}
];
const sortPage = (recordData, handleCancel) => {
	const [type, setType] = useState("1");
	const HeaderTabProps = {
		type,
		data: tabArr,
		//tab改变
		onChange(val) {
			setType(val);
		}
	};

	const SortListProps = {
		recordData
	};
	return (
		<div className="views-container">
			<HeaderTab {...HeaderTabProps} />
			{type == 1 ? <MakeInventoryPage {...SortListProps} /> : <HistoryInventoryPage {...SortListProps} />}
		</div>
	);
};

export default React.memo(sortPage, () => {
	return true;
});
